package com.gardeneaters.game_v0.autoplay;

import java.util.Vector;

public class VectorPos {

	private Vector<int[]> vector;
	
	public VectorPos(){
		this.vector = new Vector<int[]>();;
	}
	
	public VectorPos(Vector<int[]> _vector){
		this.vector = _vector;
	}
	
	public boolean isInVectorPos(int[] position){
		
		int[] tempPos;
		for(int k=0; k<vector.size(); k++)
		{
			tempPos = vector.elementAt(k);
			if(position[0] == tempPos[0] && position[1] == tempPos[1])
				return true;
		}
		return false;
	}
	
	public boolean isInVectorPos(int i, int j){
		
		int[] tempPos = {i,j};
		return isInVectorPos(tempPos);

	}
	
	public static boolean isInVector(int i, int j, Vector<int[]> vector){
		
		VectorPos tempVec = new VectorPos(vector);
		return tempVec.isInVectorPos(i,j);
	}
	
	public void addPosition(int[] position){
		if(!isInVectorPos(position))
			vector.add(position);
	}
	
	public int[] getFirstElem(){
		return vector.firstElement();
	}
	
	public Vector<int[]> getVector(){
		return vector;
	}
}
